package it.giuseppefrattura.wwdefence;


import org.andengine.engine.camera.Camera;
import org.andengine.entity.sprite.Sprite;


//import android.util.Log;

public class Enemy {

	private Sprite sprite;
	public static Enemy instance;
    Camera mCamera;
	private float px,py=0;
	private int hp;
	EnemyLogic el;
	
	public Sprite getSprite(){
		return this.sprite;
	}
	
	public void colpito() {
		el.colpito();
    }

    public boolean dead(){
    	return el.dead();
    }
    
    public void sposta(char[]... v){
    	this.sprite.registerEntityModifier(el.sposta(v));
	}
    
    public Enemy(){
    	instance=this;
    	this.px = ((GameScene)MainActivity.getSharedInstance().mCurrentScene).startX;
    	this.py = ((GameScene)MainActivity.getSharedInstance().mCurrentScene).startY;
    	this.hp=3;
    	sprite = new Sprite(px, py, MainActivity.getSharedInstance().mEn, 
        		MainActivity.getSharedInstance().getVertexBufferObjectManager());				        
        mCamera = MainActivity.getSharedInstance().mCamera;
        el = new EnemyLogic(hp, px, py);
    }
	
    public void clean() {
        sprite.clearEntityModifiers();
        sprite.clearUpdateHandlers();
    }

}
